﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows;
using System.Drawing;

namespace FrmClock.Service
{
    internal class GetComponent
    {
        
        /// <summary>
        /// 生成时间显示器
        /// </summary>
        /// <param name="panel1"></param>
        public static void GetTimeShow(Panel panel1, ProgressBar[] Bars,int left,int top,int start)
        {
            for (int i = start; i <start+ 7; i++)
            {
                ProgressBar bar = new ProgressBar();
                if (i < start+3)
                {
                    bar.Location = new Point(left+10, top+(i%7) * 60);
                    bar.Size = new Size(50,10);
                }
                
                else if (i <start+ 5)
                {
                    bar.Location = new Point(left+60 * (i%7 - 3), top+10);
                    bar.Size = new Size(10, 50);
                }
                else
                {
                    bar.Location = new Point(left+60 * (i%7 - 5), top+70);
                    bar.Size = new Size(10, 50);
                }
                Bars[i] = bar;
                panel1.Controls.Add(Bars[i]);
            }
        }
    }
}
